// source --> https://littlebeijing.edu.hk/wp-content/plugins/sticky-side-buttons/assets/js/ssb-ui-js.js?ver=6.7.1 // SSB UI jQuery jQuery(function ($) { // Animation Slide var ssb_panel = $('#ssb-container'), ssb_panel_w = ssb_panel.width(), sbb_display_margin = 50, window_width = jQuery(window).width(); ssb_panel.css('z-index', ssb_ui_data.z_index); if (ssb_panel.hasClass('ssb-btns-left') && (ssb_panel.hasClass('ssb-anim-slide') || ssb_panel.hasClass('ssb-anim-icons'))) { ssb_panel.css('left', '-' + (ssb_panel_w - sbb_display_margin) + 'px'); } else if (ssb_panel.hasClass('ssb-btns-right') && (ssb_panel.hasClass('ssb-anim-slide') || ssb_panel.hasClass('ssb-anim-icons'))) { ssb_panel.css('right', '-' + (ssb_panel_w - sbb_display_margin) + 'px'); } // Slide when hover if (window_width >= 768) { ssb_panel.hover(function () { if (ssb_panel.hasClass('ssb-btns-left') && ssb_panel.hasClass('ssb-anim-slide')) { ssb_panel.stop().animate({'left': 0}, 300); } else if (ssb_panel.hasClass('ssb-btns-right') && ssb_panel.hasClass('ssb-anim-slide')) { ssb_panel.stop().animate({'right': 0}, 300); } }, function () { if (ssb_panel.hasClass('ssb-btns-left') && ssb_panel.hasClass('ssb-anim-slide')) { ssb_panel.animate({'left': '-' + (ssb_panel_w - sbb_display_margin) + 'px'}, 300); } else if (ssb_panel.hasClass('ssb-btns-right') && ssb_panel.hasClass('ssb-anim-slide')) { ssb_panel.animate({'right': '-' + (ssb_panel_w - sbb_display_margin) + 'px'}, 300); } }); } else { ssb_panel.click(function (e) { if (jQuery(this).hasClass('ssb-open')) { jQuery(this).removeClass('ssb-open'); if (ssb_panel.hasClass('ssb-btns-left') && ssb_panel.hasClass('ssb-anim-slide')) { ssb_panel.animate({'left': '-' + (ssb_panel_w - sbb_display_margin) + 'px'}, 300); } else if (ssb_panel.hasClass('ssb-btns-right') && ssb_panel.hasClass('ssb-anim-slide')) { ssb_panel.animate({'right': '-' + (ssb_panel_w - sbb_display_margin) + 'px'}, 300); } } else { e.preventDefault(); jQuery(this).addClass('ssb-open'); if (ssb_panel.hasClass('ssb-btns-left') && ssb_panel.hasClass('ssb-anim-slide')) { ssb_panel.stop().animate({'left': 0}, 300); } else if (ssb_panel.hasClass('ssb-btns-right') && ssb_panel.hasClass('ssb-anim-slide')) { ssb_panel.stop().animate({'right': 0}, 300); } } }); } }); // source --> https://littlebeijing.edu.hk/wp-content/plugins/wonderplugin-gallery/engine/wonderplugingallery.js?ver=15.5 /** Wonderplugin Gallery Plugin Free Version * Copyright 2024 Magic Hills Pty Ltd All Rights Reserved * Website: http://www.wonderplugin.com * Version 15.5 */ var html5GalleryObjects=new function(){this.objects=[];this.addObject=function(obj){this.objects.push(obj)};this.loadNext=function(id){this.objects[id].onVideoEnd();if(!this.objects[id].isPaused)this.objects[id].slideRun(-1)};this.setHd=function(id,isHd,switching){this.objects[id].setHd(isHd,switching)};this.gotoSlide=function(slideId,galleryId){if(typeof galleryId==="undefined")galleryId=0;if(this.objects[galleryId])this.objects[galleryId].slideRun(slideId)}}; if(typeof ASYouTubeIframeAPIReady==="undefined"){var ASYouTubeIframeAPIReady=false;var ASYouTubeTimeout=0;function onYouTubeIframeAPIReady(){ASYouTubeIframeAPIReady=true}}var ASVimeoTimeout=0; function loadHtml5Gallery(jsFolder){(function($){var pow=Math.pow,sqrt=Math.sqrt,sin=Math.sin,cos=Math.cos,PI=Math.PI,c1=1.70158,c2=c1*1.525,c3=c1+1,c4=2*PI/3,c5=2*PI/4.5;function bounceOut(x){var n1=7.5625,d1=2.75;if(x<1/d1)return n1*x*x;else if(x<2/d1)return n1*(x-=1.5/d1)*x+0.75;else if(x<2.5/d1)return n1*(x-=2.25/d1)*x+0.9375;else return n1*(x-=2.625/d1)*x+0.984375}$.extend($.easing,{def:"easeOutQuad",easeInQuad:function(x){return x*x},easeOutQuad:function(x){return 1-(1-x)*(1-x)},easeInOutQuad:function(x){return x< 0.5?2*x*x:1-pow(-2*x+2,2)/2},easeInCubic:function(x){return x*x*x},easeOutCubic:function(x){return 1-pow(1-x,3)},easeInOutCubic:function(x){return x<0.5?4*x*x*x:1-pow(-2*x+2,3)/2},easeInQuart:function(x){return x*x*x*x},easeOutQuart:function(x){return 1-pow(1-x,4)},easeInOutQuart:function(x){return x<0.5?8*x*x*x*x:1-pow(-2*x+2,4)/2},easeInQuint:function(x){return x*x*x*x*x},easeOutQuint:function(x){return 1-pow(1-x,5)},easeInOutQuint:function(x){return x<0.5?16*x*x*x*x*x:1-pow(-2*x+2,5)/2},easeInSine:function(x){return 1- cos(x*PI/2)},easeOutSine:function(x){return sin(x*PI/2)},easeInOutSine:function(x){return-(cos(PI*x)-1)/2},easeInExpo:function(x){return x===0?0:pow(2,10*x-10)},easeOutExpo:function(x){return x===1?1:1-pow(2,-10*x)},easeInOutExpo:function(x){return x===0?0:x===1?1:x<0.5?pow(2,20*x-10)/2:(2-pow(2,-20*x+10))/2},easeInCirc:function(x){return 1-sqrt(1-pow(x,2))},easeOutCirc:function(x){return sqrt(1-pow(x-1,2))},easeInOutCirc:function(x){return x<0.5?(1-sqrt(1-pow(2*x,2)))/2:(sqrt(1-pow(-2*x+2,2))+1)/ 2},easeInElastic:function(x){return x===0?0:x===1?1:-pow(2,10*x-10)*sin((x*10-10.75)*c4)},easeOutElastic:function(x){return x===0?0:x===1?1:pow(2,-10*x)*sin((x*10-0.75)*c4)+1},easeInOutElastic:function(x){return x===0?0:x===1?1:x<0.5?-(pow(2,20*x-10)*sin((20*x-11.125)*c5))/2:pow(2,-20*x+10)*sin((20*x-11.125)*c5)/2+1},easeInBack:function(x){return c3*x*x*x-c1*x*x},easeOutBack:function(x){return 1+c3*pow(x-1,3)+c1*pow(x-1,2)},easeInOutBack:function(x){return x<0.5?pow(2*x,2)*((c2+1)*2*x-c2)/2:(pow(2* x-2,2)*((c2+1)*(x*2-2)+c2)+2)/2},easeInBounce:function(x){return 1-bounceOut(1-x)},easeOutBounce:bounceOut,easeInOutBounce:function(x){return x<0.5?(1-bounceOut(1-2*x))/2:(1+bounceOut(2*x-1))/2}})})(jQuery);(function($){$.fn.touchSwipe=function(options){var defaults={preventWebBrowser:false,instance:null,preventWebBrowserCallback:null,swipeLeft:null,swipeRight:null,swipeTop:null,swipeBottom:null};if(options)$.extend(defaults,options);return this.each(function(){var startX=-1,startY=-1;var curX=-1, curY=-1;function touchStart(event){var e=event.originalEvent;if(e.targetTouches.length>=1){startX=e.targetTouches[0].pageX;startY=e.targetTouches[0].pageY}else touchCancel(event)}function touchMove(event){var prevent=defaults.preventWebBrowser;var e=event.originalEvent;if(e.targetTouches.length>=1){curX=e.targetTouches[0].pageX;curY=e.targetTouches[0].pageY;if(defaults.instance&&defaults.preventWebBrowserCallback)prevent=defaults.instance[defaults.preventWebBrowserCallback](curY0||curY>0){triggerHandler();touchCancel(event)}else touchCancel(event)}function touchCancel(event){startX=-1;startY=-1;curX=-1;curY=-1}function triggerHandler(){if(Math.abs(curX-startX)>100)if(curX>startX){if(defaults.swipeRight)defaults.swipeRight.call()}else if(defaults.swipeLeft)defaults.swipeLeft.call();if(Math.abs(curY-startY)>100)if(curY>startY){if(defaults.swipeBottom)defaults.swipeBottom.call()}else if(defaults.swipeTop)defaults.swipeTop.call()} try{$(this).on("touchstart",touchStart);$(this).on("touchmove",touchMove);$(this).on("touchend",touchEnd);$(this).on("touchcancel",touchCancel)}catch(e){}})}})(jQuery);(function($){$.fn.html5boxTransition=function(id,$prev,$next,transition,callback){$parent=this;var effects=transition.effect;var easing=transition.easing;var duration=transition.duration;var direction=transition.direction;var effect=null;if(effects){effects=effects.split(",");effect=effects[Math.floor(Math.random()*effects.length)]; effect=$.trim(effect.toLowerCase())}if(effect&&transition[effect]){if("duration"in transition[effect])duration=transition[effect].duration;if(transition[effect].easing)easing=transition[effect].easing}if(effect=="fade"||effect=="fadein"){$next.hide();$prev.insertBefore($next);$next.fadeIn(duration,easing,function(){$prev.remove();callback()})}else if(effect=="fadeout"){$next.show();$prev.fadeOut(duration,easing,function(){$prev.remove();callback()})}else if(effect=="fadeinout"){$next.hide();$prev.insertBefore($next); $prev.fadeOut(duration,easing);$next.fadeIn(duration,easing,function(){$prev.remove();callback()})}else if(effect=="crossfade"){$next.hide();$prev.fadeOut(duration/2,easing,function(){$next.fadeIn(duration/2,easing,function(){$prev.remove();callback()})})}else if(effect=="slide"){$parent.css({overflow:"hidden"});if(direction){$next.css({left:"100%"});$next.animate({left:"0%"},duration,easing);$prev.animate({left:"-100%"},duration,easing,function(){$prev.remove();callback()})}else{$next.css({left:"-100%"}); $next.animate({left:"0%"},duration,easing);$prev.animate({left:"100%"},duration,easing,function(){$prev.remove();callback()})}}else{$next.show();$prev.remove();callback()}}})(jQuery);(function($){$.fn.addHTML5VideoControls=function(skinFolder,parentInst,videoElem,hideControls,hidePlayButton,defaultVolume,fullscreenNativeControls,html5VideoNoDownload,skinImages,showsubtitle,vttline,showsubtitlebydefault){var isTouch="ontouchstart"in window;var eStart=isTouch?"touchstart":"mousedown";var eMove=isTouch? "touchmove":"mousemove";var eCancel=isTouch?"touchcancel":"mouseup";var eClick="click";var BUTTON_SIZE=32;var BAR_HEIGHT=isTouch?48:36;var hideControlsTimerId=null;var hideVolumeBarTimeoutId=null;var sliderDragging=false;var isFullscreen=false;var userActive=true;var isHd=$(this).data("ishd");var hd=$(this).data("hd");var src=$(this).data("src");var $videoObj=$(this);$videoObj.get(0).removeAttribute("controls");var $videoPlay=$("
");$videoObj.after($videoPlay); var playbuttonImage=skinImages&&"playbutton"in skinImages&&skinImages.playbutton&&skinImages.playbutton.length>0?skinImages.playbutton:skinFolder+"html5boxplayer_playvideo.png";$videoPlay.css({position:"absolute",top:"50%",left:"50%",display:"block",cursor:"pointer",width:64,height:64,"margin-left":-32,"margin-top":-32,"background-image":"url('"+playbuttonImage+"')","background-position":"center center","background-repeat":"no-repeat"}).on(eClick,function(){if(parentInst.options.stopallplaying)parentInst.stopAllPlaying(); $videoObj.get(0).play()});var $videoFullscreenBg=$("
");var $videoControls=$("
"+"
"+"
"+"
"+"
"+"
"+"
--:--
"+"
"+"
"+"
"+"
"+ "
"+"
"+"
"+"
"+"
"+"
"+"
"+"
--:--
"+"
"+"
"+"
"+"
"+"
"+"
"+"
");$videoObj.after($videoControls);$videoObj.after($videoFullscreenBg); $videoFullscreenBg.css({display:"none",position:"fixed",left:0,top:0,bottom:0,right:0});$videoControls.css({display:"block",position:"absolute",width:"100%",height:BAR_HEIGHT,left:0,bottom:0,right:0,margin:"0 auto"});var userActivate=function(){userActive=true};$videoObj.on("touch click mousemove mouseenter",function(){userActive=true});if(!hideControls)setInterval(function(){if(userActive){$videoControls.show();userActive=false;clearTimeout(hideControlsTimerId);hideControlsTimerId=setTimeout(function(){if(!$videoObj.get(0).paused)$videoControls.fadeOut()}, 5E3)}},250);$(".html5boxVideoControlsBg",$videoControls).css({display:"block",position:"absolute",width:"100%",height:"100%",left:0,top:0,"background-color":"#000000",opacity:0.7,filter:"alpha(opacity=70)"});$(".html5boxPlayPause",$videoControls).css({display:"block",position:"relative",width:BUTTON_SIZE+"px",height:BUTTON_SIZE+"px",margin:Math.floor((BAR_HEIGHT-BUTTON_SIZE)/2),"float":"left"});var $videoBtnPlay=$(".html5boxPlay",$videoControls);var $videoBtnPause=$(".html5boxPause",$videoControls); $videoBtnPlay.css({display:"block",position:"absolute",top:0,left:0,width:BUTTON_SIZE+"px",height:BUTTON_SIZE+"px",cursor:"pointer","background-image":"url('"+skinFolder+"html5boxplayer_playpause.png"+"')","background-position":"top left"}).hover(function(){$(this).css({"background-position":"bottom left"})},function(){$(this).css({"background-position":"top left"})}).on(eClick,function(){if(parentInst.options.stopallplaying)parentInst.stopAllPlaying();$videoObj.get(0).play()});$videoBtnPause.css({display:"none", position:"absolute",top:0,left:0,width:BUTTON_SIZE+"px",height:BUTTON_SIZE+"px",cursor:"pointer","background-image":"url('"+skinFolder+"html5boxplayer_playpause.png"+"')","background-position":"top right"}).hover(function(){$(this).css({"background-position":"bottom right"})},function(){$(this).css({"background-position":"top right"})}).on(eClick,function(){$videoObj.get(0).pause()});var $videoTimeCurrent=$(".html5boxTimeCurrent",$videoControls);var $videoTimeTotal=$(".html5boxTimeTotal",$videoControls); var $videoSeeker=$(".html5boxSeeker",$videoControls);var $videoSeekerPlay=$(".html5boxSeekerPlay",$videoControls);var $videoSeekerBuffer=$(".html5boxSeekerBuffer",$videoControls);var $videoSeekerHandler=$(".html5boxSeekerHandler",$videoControls);$videoTimeCurrent.css({display:"block",position:"relative","float":"left","line-height":BAR_HEIGHT+"px","font-weight":"normal","font-size":"12px",margin:"0 8px","font-family":"Arial, Helvetica, sans-serif",color:"#fff"});$videoTimeTotal.css({display:"block", position:"relative","float":"right","line-height":BAR_HEIGHT+"px","font-weight":"normal","font-size":"12px",margin:"0 8px","font-family":"Arial, Helvetica, sans-serif",color:"#fff"});$videoSeeker.css({display:"block",cursor:"pointer",overflow:"hidden",position:"relative",height:"10px","background-color":"#222",margin:Math.floor((BAR_HEIGHT-10)/2)+"px 4px"}).on(eStart,function(e){var e0=isTouch?e.originalEvent.touches[0]:e;var pos=e0.pageX-$videoSeeker.offset().left;$videoSeekerPlay.css({width:pos}); $videoObj.get(0).currentTime=pos*$videoObj.get(0).duration/$videoSeeker.width();$videoSeeker.on(eMove,function(e){var e0=isTouch?e.originalEvent.touches[0]:e;var pos=e0.pageX-$videoSeeker.offset().left;$videoSeekerPlay.css({width:pos});$videoObj.get(0).currentTime=pos*$videoObj.get(0).duration/$videoSeeker.width()})}).on(eCancel,function(){$videoSeeker.off(eMove)});$videoSeekerBuffer.css({display:"block",position:"absolute",left:0,top:0,height:"100%","background-color":"#444"});$videoSeekerPlay.css({display:"block", position:"absolute",left:0,top:0,height:"100%","background-color":"#fcc500"});var $videoFSObj=fullscreenNativeControls?$videoObj:$videoObj.parent();if($videoFSObj.get(0).requestFullscreen||$videoFSObj.get(0).webkitRequestFullScreen||$videoFSObj.get(0).mozRequestFullScreen||$videoFSObj.get(0).webkitEnterFullScreen||$videoFSObj.get(0).msRequestFullscreen){var switchScreen=function(fullscreen){if(fullscreen){if(fullscreenNativeControls){$videoObj.get(0).setAttribute("controls","controls");if(html5VideoNoDownload)$videoObj.get(0).setAttribute("controlsList", "nodownload")}if($videoFSObj.get(0).requestFullscreen)$videoFSObj.get(0).requestFullscreen();else if($videoFSObj.get(0).webkitRequestFullScreen)$videoFSObj.get(0).webkitRequestFullScreen();else if($videoFSObj.get(0).mozRequestFullScreen)$videoFSObj.get(0).mozRequestFullScreen();else if($videoFSObj.get(0).webkitEnterFullScreen)$videoFSObj.get(0).webkitEnterFullScreen();if($videoFSObj.get(0).msRequestFullscreen)$videoFSObj.get(0).msRequestFullscreen()}else if(document.cancelFullScreen)document.cancelFullScreen(); else if(document.mozCancelFullScreen)document.mozCancelFullScreen();else if(document.webkitCancelFullScreen)document.webkitCancelFullScreen();else if(document.webkitExitFullscreen)document.webkitExitFullscreen();else if(document.msExitFullscreen)document.msExitFullscreen()};var switchScreenCSS=function(fullscreen){if(fullscreenNativeControls)if(fullscreen){$videoObj.get(0).setAttribute("controls","controls");if(html5VideoNoDownload)$videoObj.get(0).setAttribute("controlsList","nodownload")}else $videoObj.get(0).removeAttribute("controls"); else if(fullscreen){$(document).on("mousemove",userActivate);$videoControls.css({"z-index":2147483647,position:"fixed"});$videoFullscreenBg.css({"z-index":2147483647,display:"block"});$videoPlay.css({"z-index":2147483647})}else{$(document).off("mousemove",userActivate);$videoControls.css({"z-index":"",position:"absolute"});$videoFullscreenBg.css({"z-index":"",display:"none"});$videoPlay.css({"z-index":""})}};document.addEventListener("MSFullscreenChange",function(){isFullscreen=document.msFullscreenElement!= null;switchScreenCSS(isFullscreen)},false);document.addEventListener("fullscreenchange",function(){isFullscreen=document.fullscreen;switchScreenCSS(isFullscreen)},false);document.addEventListener("mozfullscreenchange",function(){isFullscreen=document.mozFullScreen;switchScreenCSS(isFullscreen)},false);document.addEventListener("webkitfullscreenchange",function(){isFullscreen=document.webkitIsFullScreen;switchScreenCSS(isFullscreen)},false);$videoFSObj.get(0).addEventListener("webkitbeginfullscreen", function(){isFullscreen=true;switchScreenCSS(isFullscreen)},false);$videoFSObj.get(0).addEventListener("webkitendfullscreen",function(){isFullscreen=false;switchScreenCSS(isFullscreen)},false);if(!fullscreenNativeControls)$("head").append("");var $videoFullscreen=$(".html5boxFullscreen",$videoControls);$videoFullscreen.css({display:"block",position:"relative","float":"right",width:BUTTON_SIZE+"px", height:BUTTON_SIZE+"px",margin:Math.floor((BAR_HEIGHT-BUTTON_SIZE)/2),cursor:"pointer","background-image":"url('"+skinFolder+"html5boxplayer_fullscreen.png"+"')","background-position":"left top"}).hover(function(){var backgroundPosX=$(this).css("background-position")?$(this).css("background-position").split(" ")[0]:$(this).css("background-position-x");$(this).css({"background-position":backgroundPosX+" bottom"})},function(){var backgroundPosX=$(this).css("background-position")?$(this).css("background-position").split(" ")[0]: $(this).css("background-position-x");$(this).css({"background-position":backgroundPosX+" top"})}).on(eClick,function(){isFullscreen=!isFullscreen;switchScreen(isFullscreen)})}if(hd){var $videoHD=$(".html5boxHD",$videoControls);$videoHD.css({display:"block",position:"relative","float":"right",width:BUTTON_SIZE+"px",height:BUTTON_SIZE+"px",margin:Math.floor((BAR_HEIGHT-BUTTON_SIZE)/2),cursor:"pointer","background-image":"url('"+skinFolder+"html5boxplayer_hd.png"+"')","background-position":(isHd?"right": "left")+" center"}).on(eClick,function(){isHd=!isHd;$(this).css({"background-position":(isHd?"right":"left")+" center"});parentInst.isHd=isHd;var isPaused=$videoObj.get(0).isPaused;$videoObj.get(0).setAttribute("src",(isHd?hd:src)+"#t="+$videoObj.get(0).currentTime);if(!isPaused)$videoObj.get(0).play();else $videoObj.get(0).pause()})}if(showsubtitle){var $videoCaption=$(".html5boxCaption",$videoControls);$videoCaption.css({display:"block",position:"relative","float":"right",width:BUTTON_SIZE+"px", height:BUTTON_SIZE+"px",margin:Math.floor((BAR_HEIGHT-BUTTON_SIZE)/2),cursor:"pointer","background-image":"url('"+skinFolder+"html5boxplayer_caption.png"+"')","background-position":showsubtitlebydefault?"right center":"left center"}).data("showcaption",showsubtitlebydefault).on(eClick,function(){var showcaption=!$videoCaption.data("showcaption");$videoCaption.data("showcaption",showcaption).css({"background-position":(showcaption?"right":"left")+" center"});if($videoObj.get(0).textTracks)for(var i= 0;i<$videoObj.get(0).textTracks.length;i++)$videoObj.get(0).textTracks[i].mode=showcaption?"showing":"hidden"})}$videoObj.get(0).volume=defaultVolume;var volumeSaved=defaultVolume==0?1:defaultVolume;var volume=$videoObj.get(0).volume;$videoObj.get(0).volume=volume/2+0.1;if($videoObj.get(0).volume===volume/2+0.1){$videoObj.get(0).volume=volume;var $videoVolume=$(".html5boxVolume",$videoControls);var $videoVolumeButton=$(".html5boxVolumeButton",$videoControls);var $videoVolumeBar=$(".html5boxVolumeBar", $videoControls);var $videoVolumeBarBg=$(".html5boxVolumeBarBg",$videoControls);var $videoVolumeBarActive=$(".html5boxVolumeBarActive",$videoControls);$videoVolume.css({display:"block",position:"relative","float":"right",width:BUTTON_SIZE+"px",height:BUTTON_SIZE+"px",margin:Math.floor((BAR_HEIGHT-BUTTON_SIZE)/2)}).hover(function(){clearTimeout(hideVolumeBarTimeoutId);var volume=$videoObj.get(0).volume;$videoVolumeBarActive.css({height:Math.round(volume*100)+"%"});$videoVolumeBar.show()},function(){clearTimeout(hideVolumeBarTimeoutId); hideVolumeBarTimeoutId=setTimeout(function(){$videoVolumeBar.hide()},1E3)});$videoVolumeButton.css({display:"block",position:"absolute",top:0,left:0,width:BUTTON_SIZE+"px",height:BUTTON_SIZE+"px",cursor:"pointer","background-image":"url('"+skinFolder+"html5boxplayer_volume.png"+"')","background-position":"top "+(volume>0?"left":"right")}).hover(function(){var backgroundPosX=$(this).css("background-position")?$(this).css("background-position").split(" ")[0]:$(this).css("background-position-x");$(this).css({"background-position":backgroundPosX+ " bottom"})},function(){var backgroundPosX=$(this).css("background-position")?$(this).css("background-position").split(" ")[0]:$(this).css("background-position-x");$(this).css({"background-position":backgroundPosX+" top"})}).on(eClick,function(){var volume=$videoObj.get(0).volume;if(volume>0){volumeSaved=volume;volume=0}else volume=volumeSaved;var backgroundPosY=$(this).css("background-position")?$(this).css("background-position").split(" ")[1]:$(this).css("background-position-y");$videoVolumeButton.css({"background-position":(volume> 0?"left":"right")+" "+backgroundPosY});if(volume>0)$videoObj.get(0).muted=false;$videoObj.get(0).volume=volume;$videoVolumeBarActive.css({height:Math.round(volume*100)+"%"})});$videoVolumeBar.css({display:"none",position:"absolute",left:4,bottom:"100%",width:24,height:80,"margin-bottom":Math.floor((BAR_HEIGHT-BUTTON_SIZE)/2),"background-color":"#000000",opacity:0.7,filter:"alpha(opacity=70)"});$videoVolumeBarBg.css({display:"block",position:"relative",width:10,height:68,margin:7,cursor:"pointer", "background-color":"#222"});$videoVolumeBarActive.css({display:"block",position:"absolute",bottom:0,left:0,width:"100%",height:"100%","background-color":"#fcc500"});$videoVolumeBarBg.on(eStart,function(e){var e0=isTouch?e.originalEvent.touches[0]:e;var vol=1-(e0.pageY-$videoVolumeBarBg.offset().top)/$videoVolumeBarBg.height();vol=vol>1?1:vol<0?0:vol;$videoVolumeBarActive.css({height:Math.round(vol*100)+"%"});$videoVolumeButton.css({"background-position":"left "+(vol>0?"top":"bottom")});if(vol>0)$videoObj.get(0).muted= false;$videoObj.get(0).volume=vol;$videoVolumeBarBg.on(eMove,function(e){var e0=isTouch?e.originalEvent.touches[0]:e;var vol=1-(e0.pageY-$videoVolumeBarBg.offset().top)/$videoVolumeBarBg.height();vol=vol>1?1:vol<0?0:vol;$videoVolumeBarActive.css({height:Math.round(vol*100)+"%"});$videoVolumeButton.css({"background-position":"left "+(vol>0?"top":"bottom")});if(vol>0)$videoObj.get(0).muted=false;$videoObj.get(0).volume=vol})}).on(eCancel,function(){$videoVolumeBarBg.off(eMove)})}var calcTimeFormat= function(seconds){var h0=Math.floor(seconds/3600);var h=h0<10?"0"+h0:h0;var m0=Math.floor((seconds-h0*3600)/60);var m=m0<10?"0"+m0:m0;var s0=Math.floor(seconds-(h0*3600+m0*60));var s=s0<10?"0"+s0:s0;var r=m+":"+s;if(h0>0)r=h+":"+r;return r};if(hidePlayButton)$videoPlay.hide();if(hideControls)$videoControls.hide();var setVttline=function(vttline){if($videoObj.get(0).textTracks){for(var i=0;i<$videoObj.get(0).textTracks.length;i++){$videoObj.get(0).textTracks[i].mode="hidden";if($videoObj.get(0).textTracks[i].activeCues)for(var j= 0;j<$videoObj.get(0).textTracks[i].activeCues.length;j++)$videoObj.get(0).textTracks[i].activeCues[j].line=vttline;if($videoObj.get(0).textTracks[i].cues)for(var j=0;j<$videoObj.get(0).textTracks[i].cues.length;j++)$videoObj.get(0).textTracks[i].cues[j].line=vttline}var showcaption=$(".html5boxCaption",$videoControls).data("showcaption");for(var i=0;i<$videoObj.get(0).textTracks.length;i++)$videoObj.get(0).textTracks[i].mode=showcaption?"showing":"hidden"}};var onVideoPlay=function(){if(!hidePlayButton)$videoPlay.hide(); if(!hideControls){$videoBtnPlay.hide();$videoBtnPause.show()}};var onVideoPause=function(){if(!hidePlayButton)$videoPlay.show();if(!hideControls){$videoControls.show();clearTimeout(hideControlsTimerId);$videoBtnPlay.show();$videoBtnPause.hide()}};var onVideoEnded=function(){$(window).trigger("html5lightbox.videoended");if(!hidePlayButton)$videoPlay.show();if(!hideControls){$videoControls.show();clearTimeout(hideControlsTimerId);$videoBtnPlay.show();$videoBtnPause.hide()}};var onVideoUpdate=function(){var curTime= $videoObj.get(0).currentTime;if(curTime){$videoTimeCurrent.text(calcTimeFormat(curTime));var duration=$videoObj.get(0).duration;if(duration){$videoTimeTotal.text(calcTimeFormat(duration));if(!sliderDragging){var sliderW=$videoSeeker.width();var pos=Math.round(sliderW*curTime/duration);$videoSeekerPlay.css({width:pos});$videoSeekerHandler.css({left:pos})}}}};var onVideoProgress=function(){if($videoObj.get(0).buffered&&$videoObj.get(0).buffered.length>0&&!isNaN($videoObj.get(0).buffered.end(0))&&!isNaN($videoObj.get(0).duration)){var sliderW= $videoSeeker.width();$videoSeekerBuffer.css({width:Math.round(sliderW*$videoObj.get(0).buffered.end(0)/$videoObj.get(0).duration)})}};try{$videoObj.on("canplay",function(){if(showsubtitle)setVttline(vttline)});$videoObj.on("play",onVideoPlay);$videoObj.on("pause",onVideoPause);$videoObj.on("ended",onVideoEnded);$videoObj.on("timeupdate",onVideoUpdate);$videoObj.on("progress",onVideoProgress)}catch(e){}}})(jQuery);(function($){var ELEM_ID=0,ELEM_THUMBNAIL=1,ELEM_SRC=2,ELEM_SRC_OGG=3,ELEM_SRC_WEBM= 4,ELEM_LINK=5,ELEM_LINKTARGET=6,ELEM_TITLE=7,ELEM_INFORMATION=8,ELEM_TYPE=9,ELEM_WIDTH=10,ELEM_HEIGHT=11,ELEM_POSTER=12,ELEM_HD=13,ELEM_HD_OGG=14,ELEM_HD_WEBM=15,ELEM_DURATION=16,ELEM_LIGHTBOXWIDTH=17,ELEM_LIGHTBOXHEIGHT=18,ELEM_YOUTUBEAPIKEY=19,ELEM_YOUTUBEPLAYLISTID=20,ELEM_YOUTUBEPLAYLISTMAXRESULTS=21,ELEM_LIGHTBOX=22,ELEM_POSTERWIDTH=23,ELEM_POSTERHEIGHT=24,ELEM_ALT=25;ELEM_VTT=26;ELEM_VTTLANG=27;ELEM_VTTLABEL=28;ELEM_CATEGORY=29;var TYPE_IMAGE=1,TYPE_SWF=2,TYPE_MP3=3,TYPE_PDF=4,TYPE_VIDEO_FLASH= 5,TYPE_VIDEO_MP4=6,TYPE_VIDEO_OGG=7,TYPE_VIDEO_WEBM=8,TYPE_VIDEO_YOUTUBE=9,TYPE_VIDEO_VIMEO=10,TYPE_EMBED_VIDEO=11,TYPE_IFRAME=12,TYPE_YOUTUBE_PLAYLIST=13;var html5GalleryId=0;$.fn.wonderplugingallery=function(options){var Html5Gallery=function(container,options,id){this.container=container;this.options=options;this.id=id;$(window).trigger("html5gallery.begin",[this.id]);this.options.flashInstalled=false;this.options.html5VideoSupported=!!document.createElement("video").canPlayType;this.options.isChrome= navigator.userAgent.match(/Chrome/i)!=null;this.options.isFirefox=navigator.userAgent.match(/Firefox/i)!=null;this.options.isOpera=navigator.userAgent.match(/Opera/i)!=null||navigator.userAgent.match(/OPR\//i)!=null;this.options.isSafari=navigator.userAgent.match(/Safari/i)!=null;this.options.isIE11=navigator.userAgent.match(/Trident\/7/)!=null&&navigator.userAgent.match(/rv:11/)!=null;this.options.isIE=navigator.userAgent.match(/MSIE/i)!=null&&!this.options.isOpera;this.options.isIE10=navigator.userAgent.match(/MSIE 10/i)!= null&&!this.options.isOpera;this.options.isIE9=navigator.userAgent.match(/MSIE 9/i)!=null&&!this.options.isOpera;this.options.isIE8=navigator.userAgent.match(/MSIE 8/i)!=null&&!this.options.isOpera;this.options.isIE7=navigator.userAgent.match(/MSIE 7/i)!=null&&!this.options.isOpera;this.options.isIE6=navigator.userAgent.match(/MSIE 6/i)!=null&&!this.options.isOpera;this.options.isIE678=this.options.isIE6||this.options.isIE7||this.options.isIE8;this.options.isIE6789=this.options.isIE6||this.options.isIE7|| this.options.isIE8||this.options.isIE9;this.options.isAndroid=navigator.userAgent.match(/Android/i)!=null;this.options.isIPad=navigator.userAgent.match(/iPad/i)!=null;this.options.isIPhone=navigator.userAgent.match(/iPod/i)!=null||navigator.userAgent.match(/iPhone/i)!=null;this.options.isIOS=this.options.isIPad||this.options.isIPhone;this.options.isMobile=this.options.isAndroid||this.options.isIPad||this.options.isIPhone;this.options.isIOSLess5=this.options.isIPad&&this.options.isIPhone&&(navigator.userAgent.match(/OS 4/i)!= null||navigator.userAgent.match(/OS 3/i)!=null);this.options.supportCSSPositionFixed=!this.options.isIE6&&!this.options.isIOSLess5;this.isTouch="ontouchstart"in window||this.options.forcetouch;this.eStart=this.isTouch?"touchstart":"mousedown";this.eMove=this.isTouch?"touchmove":"mousemove";this.eCancel=this.isTouch?"touchcancel":"mouseup";this.eClick="click";var v=document.createElement("video");this.options.canplaymp4=v&&v.canPlayType&&v.canPlayType("video/mp4").replace(/no/,"");this.slideshowTimeout= null;this.looptimes=0;this.updateCarouselTimeout=null;this.disableupdatecarousel=false;this.hideTitleTimeout=null;this.hideToolboxTimeout=null;this.isHd=this.options.hddefault;this.isHTML5=false;this.elemArray=[];$(".html5gallery-loading").hide();this.container.children().hide();this.container.css({"display":"block","position":"relative"});if(this.options.googlefonts&&this.options.googlefonts.length>0){var fontRef="https://fonts.googleapis.com/css?family="+this.options.googlefonts;var fontLink=document.createElement("link"); fontLink.setAttribute("rel","stylesheet");fontLink.setAttribute("type","text/css");fontLink.setAttribute("href",fontRef);document.getElementsByTagName("head")[0].appendChild(fontLink)}this.initData(this.processElemArray)};Html5Gallery.prototype={getParams:function(){var result={};var params=window.location.search.substring(1).split("&");for(var i=0;i0;i--){var index=Math.floor(Math.random()*i);var t=instance.elemArray[i];instance.elemArray[i]=instance.elemArray[index];instance.elemArray[index]=t}if(instance.options.reverse)instance.elemArray.reverse();instance.initYoutubeApi();instance.options.showcarousel=(instance.elemArray.length> 1||instance.options.showcarouselforsingle)&&instance.options.showcarousel;instance.options.watermarkcode="";if(instance.options.frve)instance.options.watermarkcode="";else if(instance.options.watermarklink.length>0)instance.options.watermarkcode="";var freeCss;if(instance.options.frve)freeCss="display:block !important;visibility:visible !important;position:absolute !important;top:10px !important;left:10px !important;width:180px;height:18px;line-height:18px;text-align:center;border-radius:5px;-moz-border-radius:5px;-webkit-border-radius:5px;background-color:#fff;color:#333;font-size:12px;font-family:Arial,Helvetica,sans-serif;"; else if(instance.options.watermark.length>0)freeCss="display:block;position:absolute;top:0px;left:0px;";else freeCss="display:none;";instance.options.watermarkcode+="
";if(instance.options.frve)instance.options.watermarkcode+=instance.options.frvem;else if(instance.options.watermark.length>0)instance.options.watermarkcode+="";instance.options.watermarkcode+= "
";if(instance.options.frve||instance.options.watermarklink.length>0)instance.options.watermarkcode+="
";instance.createMarkup();instance.createImageToolbox();if(instance.elemArray.length<=0)return;instance.initCategory();instance.createSliderTimeout();instance.createEvents();instance.loadCarousel();instance.createStyle();instance.savedElem=-1;instance.curElem=-1;instance.nextElem=-1;instance.prevElem=-1;instance.firstrun=true;instance.isPaused=!instance.options.autoslide;instance.isFullscreen= false;instance.isVideoPlaying=false;instance.showingPoster=false;instance.disableTouchSwipe=false;instance.createSocial(false);var params=instance.getParams();var firstid=instance.options.firstitemid;if("html5galleryid"in params&¶ms.html5galleryid in instance.elemArray)firstid=params["html5galleryid"];if("galleryshareid"in params&¶ms.galleryshareid in instance.elemArray)firstid=params["galleryshareid"];if("html5gallerybackid"in params&¶ms.html5gallerybackid in instance.elemArray)firstid= instance.elemArray.length-1-parseInt(params["html5gallerybackid"]);instance.slideRun(firstid);instance.firstrun=false;if(instance.options.responsive){instance.resizeGallery();$(window).resize(function(){setTimeout(function(){instance.resizeGallery()},instance.options.resizedelay)});if(instance.options.isMobile&&!instance.options.mobileresizeevent)$(window).on("orientationchange",function(){setTimeout(function(){instance.resizeGallery()},instance.options.resizedelay)})}$(window).trigger("html5gallery.inited", [instance.id,instance.curElem]);instance.initSearch()},initSearch:function(){var instance=this;$(".wondergallery-search").on("keyup",function(e){var searchText=String($.trim($(this).val())).toLowerCase();var galleryId=$(this).data("galleryid");if(!galleryId||galleryId==instance.id)instance.searchGallery(searchText)})},searchGallery:function(searchText){var instance=this;if(searchText&&searchText.length>0)for(var i=0;i= 0||instance.elemArray[i][ELEM_TITLE]&&instance.elemArray[i][ELEM_TITLE].toLowerCase().indexOf(searchText)>=0||instance.elemArray[i][ELEM_INFORMATION]&&instance.elemArray[i][ELEM_INFORMATION].toLowerCase().indexOf(searchText)>=0;$("#html5gallery-tn-"+instance.id+"-"+i).css({display:match?"block":"none"})}else $(".html5gallery-tn-"+instance.id).css({display:"block"})},resizeGallery:function(){switch(this.options.skin){case "vertical":case "verticallight":case "verticalwithleft":case "verticallightwithleft":case "showcase":this.resizeStyleVertical(); break;case "light":case "horizontal":case "darkness":case "gallery":default:this.resizeStyleDefault()}this.resizeImageToolbox()},absoluteUrl:function(href){var link=document.createElement("a");link.href=href;return link.protocol+"//"+link.host+link.pathname+link.search+link.hash},createSocial:function(isfullscreen){if(this.options.initsocial)$("head").append('');if(!this.options.showsocial)return;var instance= this;var styleCss=".html5gallery-rotate { border-radius:50%; -webkit-transition:-webkit-transform .4s ease-in; transition: transform .4s ease-in; } .html5gallery-rotate:hover { -webkit-transform: rotate(360deg); transform: rotate(360deg); }";$("head").append("");var socialCode="